<?php
/**
 * 这是一个启动类，用以演示按接口编程
 * User: ford
 * Date: 15-6-15
 * Time: 下午4:03
 */
require_once('NorthRegion.php');
require_once('WestRegion.php');

class NorthWestClient {
	function __construct(){
		$north = new NorthRegion();
		$west = new WestRegion();

		$this->showInterface($north);
		$this->showInterface($west);

	}

	/**
	 * 注意此处，以接口名声明的参数可以引用实现接口的子类
	 * @param IAbstract $region
	 */
	private function showInterface(IAbstract $region) {
		echo $region->displayShow() . '<br />';
	}
}

$worker = new NorthWestClient();